const express = require('express')
const mustache  = require('mustache')
const router = express.Router()
let htmlStr = ''

const handleCodeRequset = router.post('/compile', (req, res) => {
    htmlStr = req.body.data
    res.send({code:200, message:'success'}).status(200)
}).get('/html', (req, res) => {
    res.type('html')
    res.send(htmlStr).status(200)
})

module.exports = router.use('/code', handleCodeRequset)

